export {}
// 字面量类型

type Gender = '男' | '女'

let gender: Gender = '女'



type Direction = 'top' | 'bottom' | 'right' | 'left'

let direction: Direction = 'bottom'

// let 和 const 默认推导出来的类型不一致  const 字面量类型
let str1 = '123'
const str2 = '456'

// code码只能是 1001  1002  1003
type Res = {
  code: 1001 | 1002 | 1003
  msg: string
}
let res: Res = {
  msg: '接口成功',
  code: 1002
}